﻿
namespace DAPNet
{
    public class NaiveCorrector : IClickCorrector
    {
        public NaiveCorrector()
        {
        }

        public void Correct(SampleCollection samples, ClickDetection detection)
        {
            double heldValue = Sample.BaseValue;
            for (int sampleIndex = 0; sampleIndex < samples.Count; sampleIndex++)
            {
                if (detection[sampleIndex])
                {
                    samples[sampleIndex].SetTrimmedValue(heldValue);
                }
                else
                {
                    heldValue = samples[sampleIndex].Value;
                }
            }
        }
    }
}
